package com.example.demo.context;

import io.netty.util.concurrent.FastThreadLocal;

public class SysContext {
    private static final FastThreadLocal<String> USER_INFO = new FastThreadLocal<>();

    public static String get() {
        return USER_INFO.get();
    }

    public static void set(String userId) {
        USER_INFO.set(userId);
    }

    public static void clean() {
        if (USER_INFO.get() != null) {
            USER_INFO.remove();
            System.out.println("SysContextGetRemove"+USER_INFO.get());
        }
    }
}
